package com.woniu.goodsservice.dao;

import com.woniu.goodsservice.dto.AuctionDTO;
import com.woniu.goodsservice.dto.AuctionRoomDTO;
import com.woniu.goodsservice.entity.Auction;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AuctionDTODao {
    @Select("SELECT * FROM goods g,auction a WHERE g.isAuction=1 AND g.id=a.goodsId;")
    List<AuctionRoomDTO> selectByPage();

    @Select("select * from auction where id=#{id}")
    Auction queryById(Integer id);

    @Select("select * from auction a,goods g where g.id=a.goodsId and a.id=#{id}")
    AuctionRoomDTO selectById(Integer id);

    @Select("select g.goodsname,g.imageurl,a.startprice,a.durationtime from goods g,auction a order by a.startprice desc ")
    List<AuctionDTO> findGoodsStartprice();

    //根据报名人数降序排列
    List<AuctionDTO> findGoodsWatchpeople();


    //只展示今天的拍卖
    List<AuctionDTO> findGoodsDate();

}
